var Readable = require('stream').Readable;
var Writable = require('stream').Writable;

var readStream = new Readable();
var writeStream = new Writable();

readStream.push("I");
readStream.push("Love");
readStream.push("Imooc");
readStream.push(null); // 要加这一句，不会报错（当发送一个null时，才会停止）

writeStream._write = function (chunk, encode, cb) {
    console.log(chunk.toString());
    cb();
}
readStream.pipe(writeStream);
